<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
include  'admin/Util.php';
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
    <head>
        <?php
        include  'meta.php';
        ?>
        <title><?php echo Constants::$mainHeader ?></title>
        <?php
        include  'headIcon.php';
        ?>
        <link rel="stylesheet" type="text/css" href="media/default.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="lightbox/lightbox.css" media="screen" />
        <script type="text/javascript" src="lightbox/prototype.js"></script>
        <script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script>
        <script type="text/javascript" src="lightbox/lightbox.js"></script>
        <!-- TODO: doplnit meta copyright, description, keywords -->
    </head>
    <body>

        <h1><?php echo Constants::$mainHeader ?></h1>

        <?php
        include  'menu.php';
        ?>

        <!-- CONTENTS START -->

        <div id="contents">
            <div class="boxtop"></div>
            <div class="boxhdr"><h2>Contacts</h2></div>
            <div class="boxtxt">

                <?php

                $link = Util::getLink();

                $query = sprintf(Util::$select_jornakDestination,
                    mysql_real_escape_string("5")
                );

                $result = mysql_query($query);

                if (!$result) {
                    die('Could not query:' . mysql_error());
                }

                while ($row = mysql_fetch_assoc($result)) {
                    $textID[$i] = $row['textid'];
                    break;
                }

                $query = sprintf(Util::$select_jornakText,
                    mysql_real_escape_string($textID[$i])
                );

                $result = mysql_query($query);

                if (!$result) {
                    die('Could not query:' . mysql_error());
                }

                while ($row = mysql_fetch_assoc($result)) {
                    echo "<h3>".stripslashes($row['header'])."</h3>";
                    echo "<p>".stripslashes($row['text'])."</p><hr />";
                }

                Util::closeLink($link);

                ?>

                <h3>Contact Form</h3>
                <script type="text/javascript">
                    var RecaptchaOptions = {
                        theme : 'clean'
                    };
                </script>
                <form action="sendMailToFibix.php" method="post" onsubmit="">
                    <label for="email">e-mail</label><label for="subject">subject</label><br /><br />                    
                    <input type="text" name="email" id="email" value="" /><input type="text" name="subject" id="subject" value="" /><br /><br />
                    <label for="text">message</label><br />
                    <textarea name="text" id="text"></textarea><br /><br/>
                    <?php
                    require_once('recaptcha-php-1.11/recaptchalib.php');
                    $publickey = Constants::$publicKey; // you got this from the signup page
                    echo recaptcha_get_html($publickey);
                    ?>

                    <input type="submit" id="submit" value="send message" />
                </form>

                <div id="cleaner"></div>
            </div>
            <div class="boxbtm"></div>
        </div>

        <!-- CONTENTS END -->

        <?php
        include  'footer.php';
        ?>

    </body>
    <?php include 'googleAnalyt.php';?>
</html>